package org.hades.corelib.base.data


/**
 * A generic class that holds a value with its loading status.
 * @param <T>
 */
sealed class UIState {
    object OnComplete: UIState()
    data class OnExecption(val exception: Exception) : UIState()
    object OnLoading : UIState()

    override fun toString(): String {
        return when (this@UIState) {
            is OnComplete -> "Complete"
            is OnExecption -> "Error[exception=$exception]"
            is OnLoading -> "Loading"
        }
    }
}
